package com.shuwen.gcdj.common.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("ws通知返回对象")
public class NoticeWebsocketResult<T> {

    @ApiModelProperty(value = "通知类型")
    private String noticeType;
    @ApiModelProperty(value = "通知内容")
    private T noticeInfo;

    protected NoticeWebsocketResult(String noticeType, T noticeInfo) {
        this.noticeType = noticeType;
        this.noticeInfo = noticeInfo;
    }
    public static <T> NoticeWebsocketResult<T> data(T noticeInfo, String noticeType) {
        return new NoticeWebsocketResult<T>(noticeType, noticeInfo);
    }
}
